home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / funkybee.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  10KB  |  330 lines

  1. /***************************************************************************
  2.  
  3. Funky Bee/Sky Lancer memory map (preliminary)
  4.  
  5. driver by Zsolt Vasvari
  6.  
  7. MAIN CPU:
  8.  
  9. 0000-4fff ROM
  10. 8000-87ff RAM
  11. a000-bfff video RAM (only 0x20 bytes of each 0x100 byte block is used)
  12.                     (also contains sprite RAM)
  13. c000-dfff color RAM (only 0x20 bytes of each 0x100 byte block is used)
  14.                     (also contains sprite RAM)
  15.  
  16. read:
  17. f000      interrupt ACK
  18. f800      IN0/watchdog
  19. f801      IN1
  20. f802      IN2
  21.  
  22. write:
  23. e000      row scroll
  24. e800      ???
  25. e802-e803 coin counter
  26. e804      ???
  27. e805      gfx bank select
  28. e806      ???
  29. f800      watchdog
  30.  
  31.  
  32. I/0 ports:
  33. write
  34. 00        8910  control
  35. 01        8910  write
  36.  
  37. AY8910 Port A = DSW
  38.  
  39. ***************************************************************************/
  40.  
  41. #include "driver.h"
  42. #include "vidhrdw/generic.h"
  43.  
  44.  
  45.  
  46. extern unsigned char *funkyb_row_scroll;
  47.  
  48. void funkybee_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  49. void funkybee_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  50.  
  51. WRITE_HANDLER( funkybee_gfx_bank_w );
  52.  
  53.  
  54. static READ_HANDLER( funkybee_input_port_0_r )
  55. {
  56.     watchdog_reset_r(0);
  57.     return input_port_0_r(offset);
  58. }
  59.  
  60.  
  61. static struct MemoryReadAddress readmem[] =
  62. {
  63.     { 0x0000, 0x4fff, MRA_ROM },
  64.     { 0x8000, 0x87ff, MRA_RAM },
  65.     { 0xa000, 0xdfff, MRA_RAM },
  66.     { 0xf000, 0xf000, MRA_NOP },    /* IRQ Ack */
  67.     { 0xf800, 0xf800, funkybee_input_port_0_r },
  68.     { 0xf801, 0xf801, input_port_1_r },
  69.     { 0xf802, 0xf802, input_port_2_r },
  70.     { -1 }    /* end of table */
  71. };
  72.  
  73. static struct MemoryWriteAddress writemem[] =
  74. {
  75.     { 0x0000, 0x4fff, MWA_ROM },
  76.     { 0x8000, 0x87ff, MWA_RAM },
  77.     { 0xa000, 0xbfff, videoram_w, &videoram, &videoram_size },
  78.     { 0xc000, 0xdfff, colorram_w, &colorram },
  79.     { 0xe000, 0xe000, MWA_RAM, &funkyb_row_scroll },
  80.     { 0xe802, 0xe803, coin_counter_w },
  81.     { 0xe805, 0xe805, funkybee_gfx_bank_w },
  82.     { 0xf800, 0xf800, watchdog_reset_w },
  83.     { -1 }    /* end of table */
  84. };
  85.  
  86.  
  87. static struct IOReadPort readport[] =
  88. {
  89.     { 0x02, 0x02, AY8910_read_port_0_r },
  90.     { -1 }    /* end of table */
  91. };
  92.  
  93. static struct IOWritePort writeport[] =
  94. {
  95.     { 0x00, 0x00, AY8910_control_port_0_w },
  96.     { 0x01, 0x01, AY8910_write_port_0_w },
  97.     { -1 }    /* end of table */
  98. };
  99.  
  100.  
  101. INPUT_PORTS_START( funkybee )
  102.     PORT_START      /* IN0 */
  103.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  104.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  105.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  106.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  107.     PORT_DIPNAME( 0x20, 0x20, "Freeze" )
  108.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  109.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  110.  
  111.     PORT_START      /* IN1 */
  112.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  113.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  114.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  115.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  116.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  117.     PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  118.  
  119.     PORT_START        /* IN2 */
  120.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  121.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  122.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  123.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  124.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  125.     PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  126.  
  127.     PORT_START      /* DSW */
  128.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  129.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  130.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  131.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
  132.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )
  133.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  134.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  135.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  136.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_3C ) )
  137.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
  138.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
  139.     PORT_DIPSETTING(    0x30, "3" )
  140.     PORT_DIPSETTING(    0x20, "4" )
  141.     PORT_DIPSETTING(    0x10, "5" )
  142.     PORT_DIPSETTING(    0x00, "6" )
  143.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  144.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  145.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  146.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  147.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  148.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  149. INPUT_PORTS_END
  150.  
  151. INPUT_PORTS_START( skylancr )
  152.     PORT_START      /* IN0 */
  153.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  154.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  155.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  156.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  157.     PORT_DIPNAME( 0x20, 0x20, "Freeze" )
  158.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  159.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  160.  
  161.     PORT_START      /* IN1 */
  162.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  163.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  164.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  165.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  166.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  167.     PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  168.  
  169.     PORT_START        /* IN2 */
  170.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  171.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  172.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  173.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  174.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  175.     PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  176.  
  177.     PORT_START      /* DSW */
  178.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  179.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  180.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  181.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
  182.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
  183.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  184.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  185.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  186.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_3C ) )
  187.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
  188.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
  189.     PORT_DIPSETTING(    0x30, "3" )
  190.     PORT_DIPSETTING(    0x20, "4" )
  191.     PORT_DIPSETTING(    0x10, "5" )
  192.     PORT_DIPSETTING(    0x00, "6" )
  193.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) )
  194.     PORT_DIPSETTING(    0x40, "20000 50000" )
  195.     PORT_DIPSETTING(    0x00, "40000 70000" )
  196.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  197.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  198.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  199. INPUT_PORTS_END
  200.  
  201.  
  202. static struct GfxLayout charlayout =
  203. {
  204.     8,8,    /* 8*8 characters */
  205.     256,    /* 256 characters */
  206.     2,        /* 2 bits per pixel */
  207.     { 0, 4 },    /* the two bitplanes for 4 pixels are packed into one byte */
  208.     { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3 },
  209.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  210.     16*8    /* every char takes 16 bytes */
  211. };
  212.  
  213. static struct GfxLayout spritelayout =
  214. {
  215.     8,32,    /* 8*32 sprites */
  216.     128,        /* 128 sprites */
  217.     2,        /* 2 bits per pixel */
  218.     { 0, 4 },    /* the two bitplanes for 4 pixels are packed into one byte */
  219.     { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3 },
  220.     {  0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  221.       16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8,
  222.       32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8,
  223.       48*8, 49*8, 50*8, 51*8, 52*8, 53*8, 54*8, 55*8 },
  224.     4*16*8    /* every sprite takes 64 bytes */
  225. };
  226.  
  227. static struct GfxDecodeInfo gfxdecodeinfo[] =
  228. {
  229.     { REGION_GFX1, 0, &charlayout,    0, 8 },
  230.     { REGION_GFX2, 0, &charlayout,    0, 8 },
  231.     { REGION_GFX1, 0, &spritelayout, 16, 4 },
  232.     { REGION_GFX2, 0, &spritelayout, 16, 4 },
  233.     { -1 } /* end of array */
  234. };
  235.  
  236.  
  237. static struct AY8910interface ay8910_interface =
  238. {
  239.     1,    /* 1 chip */
  240.     1500000,    /* 1.5 MHZ?????? */
  241.     { 50 },
  242.     { input_port_3_r },
  243.     { 0 },
  244.     { 0 },
  245.     { 0 }
  246. };
  247.  
  248.  
  249. static struct MachineDriver machine_driver_funkybee =
  250. {
  251.     /* basic machine hardware */
  252.     {
  253.         {
  254.             CPU_Z80,
  255.             3072000,    /* 3.072 Mhz */
  256.             readmem,writemem,readport,writeport,
  257.             interrupt,1
  258.         }
  259.     },
  260.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  261.     1,    /* single CPU game */
  262.     0,
  263.  
  264.     /* video hardware */
  265.     32*8, 32*8, { 12, 32*8-1-12, 0*8, 28*8-1 },
  266.     gfxdecodeinfo,
  267.     32,32,
  268.     funkybee_vh_convert_color_prom,
  269.  
  270.     VIDEO_TYPE_RASTER,
  271.     0,
  272.     generic_vh_start,
  273.     generic_vh_stop,
  274.     funkybee_vh_screenrefresh,
  275.  
  276.     /* sound hardware */
  277.     0,0,0,0,
  278.     {
  279.         {
  280.             SOUND_AY8910,
  281.             &ay8910_interface
  282.         }
  283.     }
  284. };
  285.  
  286.  
  287. /***************************************************************************
  288.  
  289.   Game driver(s)
  290.  
  291. ***************************************************************************/
  292.  
  293. ROM_START( funkybee )
  294.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  295.     ROM_LOAD( "funkybee.1",    0x0000, 0x1000, 0x3372cb33 )
  296.     ROM_LOAD( "funkybee.3",    0x1000, 0x1000, 0x7bf7c62f )
  297.     ROM_LOAD( "funkybee.2",    0x2000, 0x1000, 0x8cc0fe8e )
  298.     ROM_LOAD( "funkybee.4",    0x3000, 0x1000, 0x1e1aac26 )
  299.  
  300.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  301.     ROM_LOAD( "funkybee.5",    0x0000, 0x2000, 0x86126655 )
  302.  
  303.     ROM_REGION( 0x2000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  304.     ROM_LOAD( "funkybee.6",    0x0000, 0x2000, 0x5fffd323 )
  305.  
  306.     ROM_REGION( 0x0020, REGION_PROMS )
  307.     ROM_LOAD( "funkybee.clr",  0x0000, 0x0020, 0xe2cf5fe2 )
  308. ROM_END
  309.  
  310. ROM_START( skylancr )
  311.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  312.     ROM_LOAD( "1.5a",          0x0000, 0x2000, 0x82d55824 )
  313.     ROM_LOAD( "2.5c",          0x2000, 0x2000, 0xdff3a682 )
  314.     ROM_LOAD( "3.5d",          0x4000, 0x1000, 0x7c006ee6 )
  315.  
  316.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  317.     ROM_LOAD( "4.6a",          0x0000, 0x2000, 0x0f8ede07 )
  318.  
  319.     ROM_REGION( 0x2000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  320.     ROM_LOAD( "5.6b",          0x0000, 0x2000, 0x24cec070 )
  321.  
  322.     ROM_REGION( 0x0020, REGION_PROMS )
  323.     ROM_LOAD( "18s030.1a",     0x0000, 0x0020, 0xe645bacb )
  324. ROM_END
  325.  
  326.  
  327.  
  328. GAMEX( 1982, funkybee, 0, funkybee, funkybee, 0, ROT90, "Orca Corporation", "Funky Bee", GAME_NO_COCKTAIL )
  329. GAMEX( 1983, skylancr, 0, funkybee, skylancr, 0, ROT90, "Orca (Esco Trading Co license)", "Sky Lancer", GAME_NO_COCKTAIL )
  330.